﻿using System;

class NumberOfWorkdays
{
    public static void Main()
    {
        DateTime[] holidays =
        {
            new DateTime(2013, 1, 1),
            new DateTime(2013, 3, 3),
            new DateTime(2013, 5, 1),
            new DateTime(2013, 5, 2),
            new DateTime(2013, 5, 3),
            new DateTime(2013, 5, 6),
            new DateTime(2013, 5, 24),
            new DateTime(2013, 9, 6),
            new DateTime(2013, 12, 24),
            new DateTime(2013, 12, 25),
            new DateTime(2013, 12, 26),
            new DateTime(2013, 12, 31)
        };

        DateTime[] workingSaturdays =
        {
            new DateTime(2013, 5, 11),
            new DateTime(2013, 12, 14)            
        };

        int day = 31;
        int month = 12;
        int year = 2013;

        DateTime currentDay = DateTime.Today;
        DateTime lastDay = new DateTime(year, month, day);
        int period = Math.Abs((lastDay - currentDay).Days);       

        Console.WriteLine(period);

        int workDays = 0;

        // Chcking all days of the period
        for (int i = 0; i < period; i++)
        {
            currentDay = currentDay.AddDays(1);

            // Skipping the weekends
            if (currentDay.DayOfWeek != DayOfWeek.Sunday && currentDay.DayOfWeek != DayOfWeek.Saturday)
            {
                workDays += WorkDay(holidays, currentDay);
            }

            // Checking for working Saturdays
            workDays += WorkSaturday(workingSaturdays, currentDay);
        }

        Console.WriteLine(workDays);
    }

    private static int WorkSaturday(DateTime[] workingSaturdays, DateTime currentDay)
    {
        for (int k = 0; k < workingSaturdays.Length; k++)
        {
            if (currentDay == workingSaturdays[k])
            {
                return 1;
            }
        }
        return 0;
    }

    private static int WorkDay(DateTime[] holidays, DateTime currentDay)
    {
        for (int j = 0; j < holidays.Length; j++)
        {
            if (currentDay == holidays[j])
            {
                return 0;
            }
        }

        return 1;
    }
}
